package com.zmhc.product.service.impl;

import java.util.List;
import com.zmhc.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zmhc.product.mapper.GoodsGalleryMapper;
import com.zmhc.product.domain.GoodsGallery;
import com.zmhc.product.service.IGoodsGalleryService;

/**
 * 商品相册Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-11
 */
@Service
public class GoodsGalleryServiceImpl implements IGoodsGalleryService 
{
    @Autowired
    private GoodsGalleryMapper goodsGalleryMapper;

    /**
     * 查询商品相册
     * 
     * @param id 商品相册主键
     * @return 商品相册
     */
    @Override
    public GoodsGallery selectGoodsGalleryById(Long id)
    {
        return goodsGalleryMapper.selectGoodsGalleryById(id);
    }

    /**
     * 查询商品相册列表
     * 
     * @param goodsGallery 商品相册
     * @return 商品相册
     */
    @Override
    public List<GoodsGallery> selectGoodsGalleryList(GoodsGallery goodsGallery)
    {
        return goodsGalleryMapper.selectGoodsGalleryList(goodsGallery);
    }

    /**
     * 新增商品相册
     * 
     * @param goodsGallery 商品相册
     * @return 结果
     */
    @Override
    public int insertGoodsGallery(GoodsGallery goodsGallery)
    {
        goodsGallery.setCreateTime(DateUtils.getNowDate());
        return goodsGalleryMapper.insertGoodsGallery(goodsGallery);
    }

    /**
     * 修改商品相册
     * 
     * @param goodsGallery 商品相册
     * @return 结果
     */
    @Override
    public int updateGoodsGallery(GoodsGallery goodsGallery)
    {
        goodsGallery.setUpdateTime(DateUtils.getNowDate());
        return goodsGalleryMapper.updateGoodsGallery(goodsGallery);
    }

    /**
     * 批量删除商品相册
     * 
     * @param ids 需要删除的商品相册主键
     * @return 结果
     */
    @Override
    public int deleteGoodsGalleryByIds(Long[] ids)
    {
        return goodsGalleryMapper.deleteGoodsGalleryByIds(ids);
    }

    /**
     * 删除商品相册信息
     * 
     * @param id 商品相册主键
     * @return 结果
     */
    @Override
    public int deleteGoodsGalleryById(Long id)
    {
        return goodsGalleryMapper.deleteGoodsGalleryById(id);
    }
}
